#!/bin/bash
e="\x1b[";c=$e"00m";y=$e"93;01m";cy=$e"96;01m";bb=$e"96;44;01m";r=$e"1;91m";g=$e"92;01m";m=$e"95;01m";
##########################################################
#                                                        #
#           Carliv Image Kitchen for Android             #
#       boot & recovery images (c)-2021 carliv.eu        #
#    including support for MTK powered phones images     #
#                                                        #
##########################################################
abort() { cd "$PWD"; echo " "; echo -e "$cy >>$c$r Exit script$c\n"; }
###########################################################
bin="$PWD/.bin";
chmod -R 755 "$bin"/*;
cd "$PWD";
imageinfo=$bin/imageinfo;
###########################################################
clear;
echo -e "$bb
*****************************************************
*                                                   *
*        Carliv Image Kitchen for Android v2.3      *
*      boot & recovery images (c)2021 carliv.eu     *
*  including support for MTK powered phones images  *
*                 LINUX x86 version                 *
*                                                   *
*****************************************************$c
*           Printing the image info script          *
***************************************************** 
";     
###########################################################
if [ ! "$1" ]; 
  then
  echo -e "$r No image file selected. ERROR!$c";
  abort;
  exit 1;
fi;
###########################################################
file=$(basename "$1");
echo "Your image is: $file";
echo " ";
###########################################################
echo -e "Display the informations for $y $file$c";
echo " ";
if [ -e "file_info.txt" ];
	then
	cat file_info.txt;
	else
	$imageinfo -i "$file";
	$imageinfo -i "$file" > file_info.txt;
fi;
echo "Done!";
echo " ";
